Skip to main content

All Questions

1vote
1answer
65views

How to remove xarray plot bad value edge colour

I know set_bad can colour the pixel into a specific colour but in my example I only want to have edge colour for blue and grey pixels with values and not the bad pixels (red) import matplotlib.pyplot ...
Jane's user avatar
  • 626
0votes
0answers
74views

Cartopy facecolor='' not working as intended only for certain projections

I am using Cartopy 0.23.0 on a Windows 11 OS installed via conda-forge, Xarray version 2023.6.0, matplotlib version 3.8.4, and Python 3.9.19 . I am seeing strange behavior that I cannot figure out ...
beckib's user avatar
1vote
1answer
318views

How to apply stippling to contourf plots in Python?

I want to add stippling to Xarray DataArray data to indicate significance. The data is 2D climate data on a lat lon grid. I want to give a True/False mask to plot over mapped variable data. I am ...
Gen Tolhurst's user avatar
0votes
1answer
131views

How do I animate xarray data using matplotlib?

I am trying to animate a plot using matplotlib's FuncAnimation, however it never outputs anything. The data is NetCDF, precipitation rates for the USA with coords for day, x and y. The x is longitude ...
clavulinopsis's user avatar
0votes
0answers
145views

Clip spatial data to polygon in python

Good day, I am trying to create a spatial plot of gridded precipitation data. I have opened the netCDF using xarray. However, the data is currently not land-only (Figure 1) and I want it to only cover ...
Jessica's user avatar
0votes
0answers
58views

Remove white spaces in subplots matplolib

I try to plot the subplots as shown below. It works okay but it still have some white spaces at the end of figure. Is it possible remove white spaces. Any help would be very great. Here is the code ...
Tuyen's user avatar
  • 1,141
3votes
2answers
215views

Using xarray with resample and interpolate to animate the movement of contours

Lets say I have the following python code, showing a contour value at 12pm and 1pm, indicating that it's position has moved: import xarray as xr import numpy as np import matplotlib.pyplot as plt from ...
John's user avatar
  • 401
0votes
1answer
491views

How to use matplotlib.pyplot.contourf to plot a density array

I have an xarray Dataset called dens that I would like to plot. This is the Dataset: <xarray.Dataset> Dimensions: (time: 641, lat: 30, lon: 30) Coordinates: * time (time) datetime64[ns] ...
Yotam Ben Saadon's user avatar
1vote
0answers
41views

Quiverplot adds a number to the plot in top right corner [duplicate]

I have an xarray's dataset (DS in the code below) with geophysical data. When I am plotting it using quiver, a dot with a number appears in the top right corner, outside of the plot's range: the dot. ...
Rychnowski's user avatar
0votes
1answer
58views

Looping through plots, then taking sum of a select number of plots

I am trying to create a function that plots EOFs and loops through each mode. This part is fine and I had no trouble getting out a plot of the 12 EOFs. However, now I would like to sum across the ...
humanoid_physics's user avatar
0votes
1answer
626views

Issue plotting WRF Data with Lambert Projection -Coastlines overlay not being displayed on top of data

I recently started using python via jupyter on windows to plot netCDF data. However I am having issues plotting output data I have from a WRF run that uses Lambert Conformal projection. I cannot seem ...
Jean's user avatar
-2votes
1answer
27views

Why some data is missing on a figure when I define the axes? My dataset is a DataArray and some values are masked [duplicate]

I would like to be able to define my axis and not lose information. Currently, I am missing the last data point in both dimensions I defined (see figure). DATA = xr.DataArray(np.random.rand(74,13),...
Anne Sophie 's user avatar
1vote
0answers
174views

Embedding cartopy maps in subplots using the inset_axes method

I have created multiple cross sections of the ocean at specific longitudes, I would like to include a map that shows the location of each cross section, inside the subplot of each of the cross ...
Jan's user avatar
  • 11
2votes
1answer
370views

calculate the partial derivatives of temperature (horizontal advection of temperature)

I would like to know which way is the most correct to calculate the partial derivatives of temperature in the x and y directions (horizontal advection of temperature) The second code used the data ...
leojim19's user avatar
-1votes
1answer
116views

calculate the MCS index

I would like to optimize the code to calculate the MCS index for the Southern Hemisphere using the formula ( # SA − MCS index = [Shear (0–6 km) –20.01] ∕7.87 + [ gradiente_horizontal (775 hPa) –4.84 × ...
leojim19's user avatar

153050per page
close